package com.bjmashibing.system;

import com.bjmashibing.system.huawei.domain.Machine;
import com.bjmashibing.system.huawei.domain.Person;
import com.bjmashibing.system.huawei.domain.Token;
import com.bjmashibing.system.huawei.jdbc.SpringJdbcTemplate;
import com.bjmashibing.system.huawei.static_var;
import com.bjmashibing.system.huawei.udp_cmd;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.sql.Timestamp;
import java.util.*;

/**
 * @Classname Test
 * @Description TODO
 * @Date 2020/9/17/017 18:50
 * @Created by Administrator
 */
public class Test3 {
    private final static Logger logger = LoggerFactory.getLogger(Test3.class);



    @Test
    public void test() {


//        static_var.database_to_map();
       /* static_var.write_data_into_map("70804160554187","China","brandHONOR",
                "0865968032262745300008195200CN0100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111");*/
//        static_var.push_msg_for_machine_name("撤防","70804160554187","000","|1400 00 000");




//        Map<String, List<Token>> map = new HashMap<String, List<Token>>();
        /*SpringJdbcTemplate springJdbcTemplate = new SpringJdbcTemplate();
        List<Machine> list = springJdbcTemplate.machine_list_query2();
        for (int i = 0;i < list.size();i++) {
            String str_machine_name = list.get(i).getMachine_name();
            int id = list.get(i).getId();
            logger.info("id=" + id);
            logger.info("machine_name=" + str_machine_name);
            static_var.map_machine.put(str_machine_name,id);

            List<Token> list2 = springJdbcTemplate.token_list_query_for_machine_id(id);
            for (int ii = 0;ii < list2.size();ii++) {
//                logger.info("token_name=" + list2.get(ii).getToken_name());
                static_var.map_token.put(str_machine_name,list2);
            }
        }

        logger.info("static_var.map_machine=" + static_var.map_machine);
        logger.info("static_var.map_token=" + static_var.map_token);*/


       /* List<Token> list_token = static_var.map_token.get("70804160554187");
        logger.info("list_token=" + list_token);
        Token token = new Token();
        token.setToken_name("0865968032262745300008195200CN0100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111");
        token.setLanguage("China");
        token.setBrand("brandHONOR");
        java.util.Date date = new java.util.Date();          // 获取一个Date对象
        Timestamp timeStamp = new Timestamp(date.getTime());
        token.setCreate_time(timeStamp.toString());
        token.setMachine_id(40);
        list_token.add(token);
        logger.info("list_token=" + list_token);
        static_var.map_token.put("70804160554187",list_token);
        logger.info("static_var.map_token=" + static_var.map_token);*/




        /*List<Token> list_token = static_var.map_token.get("70804160554187");
        if (!((list_token == null) || list_token.isEmpty())) {
            logger.info("list_token=" + list_token);
            logger.info("list_token.size=" + list_token.size());
            for (int i = 0;i < list_token.size();i++) {
                String str_token = list_token.get(i).getToken_name();
                String str_language = list_token.get(i).getLanguage();
                String str_brand = list_token.get(i).getBrand();

                logger.info("str_token=" + str_token);
                logger.info("str_language=" + str_language);
                logger.info("str_brand=" + str_brand);
            }
        }*/



        /*List<Token> list2 = springJdbcTemplate.token_list_query_for_machine_id(38);
        for (int ii = 0;ii < list2.size();ii++) {
            logger.info("token_name=" + list2.get(ii).getToken_name());
        }*/
//        springJdbcTemplate.token_list_query();
        /*Token token = new Token();
        token.setId(1);
        token.setToken_name("AHGYbMDnDiNHmW0QDCjXeddGaDfqcrDM8eNp51oxnEIB6pBiNHLBHMzxq-TkEgI0qGq2bXzGa5xxISXe9t0j8AifanpWkAs_BRP_tNGEqeDNBH1WRkZlTyP8SQ8OKp6zOg");
        token.setLanguage("China");
        token.setBrand("brandHONOR");
        java.util.Date date = new java.util.Date();          // 获取一个Date对象
        Timestamp timeStamp = new Timestamp(date.getTime());*/


    }


}



